# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-iampoliciesgonewild
pkgname=('python2-iampoliciesgonewild' 'python-iampoliciesgonewild')
_pkgname=iampoliciesgonewild
pkgver=1.0.6.2
pkgrel=9
pkgdesc='AWS IAM Policy Expander Minimizer.'
arch=('any')
url='https://pypi.org/project/iampoliciesgonewild/#files'
license=('APACHE')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://pypi.python.org/packages/2e/89/4e0865e94fcf80ec7d2dd5ff8283f4921d0915cd3e0a4a1b20eac542eb97/$_pkgname-$pkgver.tar.gz")
sha512sums=('32ed042c504a08be683b5aa35a4317109b692f9af831fca3d848f46f7c55a1bf2e7948044fd8647aeea783044902ff101e4bbbb23ebe72f5427a080d74fefee5')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-iampoliciesgonewild() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-iampoliciesgonewild() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

